package com.ha7419x.service.impl;

import com.ha7419x.dao.IUserDao;
import com.ha7419x.service.IUserService;
import com.ha7419x.vo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserServiceImpl implements IUserService {

    @Resource
    private IUserDao userDao;

    @Override
    public User get(Long id) {
        return this.userDao.findById(id);
    }

    @Override
    public boolean add(User user) {
        return this.userDao.doCreate(user);
    }

    @Override
    public boolean addWithNo(User user) {
        return this.userDao.doCreateWithNo(user);
    }

    @Override
    public List<User> list() {
        return this.userDao.findAll();
    }
}
